<?php
//新增菜式时使用，按照条件列出所有菜式。
//根据传递过来的参数，显示指定的菜式或全部菜式。

function get_dishes_list($mealterm)
{



    if($mealterm)
    {$conditionstr="where at ='".$mealterm."' and publish = '1'";}
    else
    {$conditionstr="where publish = '1'";}



 $sqlstr="select * from dishes ".$conditionstr." order by product_id asc";

$result = mysql_query($sqlstr);


while ($row = mysql_fetch_array($result))
{
    $detail['nid'][]   = $row['product_id'];
    $detail['price'][] = $row['price'];
    $detail['name'][]  = $row['product_name'];
    $detail['at'][]    = $row['at'];
}

mysql_close($con);

    return $detail;

}








